// ActionScript file
import com.flex.core.event.URLEvent;

import flash.display.Loader;

/**
 * @author sam
 */
/**
 * base static function for load swf, this function will do completeEvent after swf load complete
 * @param url swfPath
 * @param completeEvent
 */
public function loadSWF(url:String, completeEvent:String):void
{
	var swf:Loader=new Loader();
	swf.load(new URLRequest(encodeURI(url)));
	swf.contentLoaderInfo.addEventListener(Event.COMPLETE, function():void
	{
		dispatchEvent(new URLEvent(completeEvent, {temp: swf.contentLoaderInfo.loader.content}));
	});
}

